package com.gcxy.dto.Ranch;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.NumberFormat;

import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * @auther:韦林鹏 `*@since:2023/12/21 11 49
 * @description:
 */
@Data
public class InsertDto {

    @NotEmpty(message = "牧场牧场不能为空")
    @Length(max = 100, message = "牧场名称长度最长为100")
    private String ranchName;
//
    @Pattern(regexp = "^(?!0)[1-9]\\d{2,5}$",message = "场地规模为100-999999，且只能输入整数")
    private String ranchArea;

    @Pattern(regexp = "^([1-9]\\d{2,5}|0)$",message = "养殖范围为0-999999，且只能输入整数")
    private String ranchFeed;

    @NotEmpty(message = "省不为空")
    private String province;

    @NotEmpty(message = "市不为空")
    private String city;

    @NotEmpty(message = "区不为空")
    private String county;

    @NotEmpty(message = "详细地址不为空")
    private String address;

    @DecimalMin(value = "-180.0", inclusive = true,message = "最小-180")
    @DecimalMax(value = "180.0", inclusive = true,message = "最大180")
    @Digits(integer = 9, fraction = 6)
    private BigDecimal longitude;

    @DecimalMin(value = "-90.0", inclusive = true,message = "最小-90")
    @DecimalMax(value = "90.0", inclusive = true,message = "最大90")
    @Digits(integer = 9, fraction = 6)
    private BigDecimal latitude;

    @NotNull(message = "牲畜品种不为空")
    private Integer dicId;
}
